package com.hnit.controller;

import com.hnit.entity.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.java.Log;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Random;

@Log
@RestController
@Tag(name = "看看hello",description = "hello接口")
public class HelloController {
    private final String[] greetings = {
            "Hello World",
            "你好，世界",
            "Hola Mundo",
            "Bonjour le Monde",
            "こんにちは世界"
    };
    @Operation(summary = "hello 尹维大帅哥的hello接口")
    @GetMapping("/hello")
    public Result<String> hello() {
        log.info("有请求来了");
        Random random = new Random();
        String msg = greetings[random.nextInt(greetings.length)];
        return Result.success(msg);
    }
}